function l2 = computeL2Distance(mix1, mix2)

e11 = 0;
for i = 1:mix1.ncentres
    for j = 1:mix1.ncentres
        e11 = e11 + mix1.priors(i)*mix1.priors(j)*computeIntegral(mix1.centres(i, :), mix1.covars(:, :, i), mix1.centres(j, :), mix1.covars(:, :, j));
    end
end

e22 = 0;
for i = 1:mix2.ncentres
    for j = 1:mix2.ncentres
        e22 = e22 + mix2.priors(i)*mix2.priors(j)*computeIntegral(mix2.centres(i, :), mix2.covars(:, :, i), mix2.centres(j, :), mix2.covars(:, :, j));
    end
end

e12 = 0;
for i = 1:mix1.ncentres
    for j = 1:mix2.ncentres
        e12 = e12 + mix1.priors(i)*mix2.priors(j)*computeIntegral(mix1.centres(i, :), mix1.covars(:, :, i), mix2.centres(j, :), mix2.covars(:, :, j));
    end
end

l2 = e11+e22-2*e12;




function integ = computeIntegral(mu1, sigma1, mu2, sigma2)

integ = gauss(mu1-mu2, sigma1+sigma2, zeros(size(mu1)));
